package com.revzone.demo001.entity.LogEntity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.revzone.demo001.entity.OtherEntity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author lsa
 * @since 2023-04-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("access_logs")
public class AccessLogs extends BaseEntity<AccessLogs> implements Serializable {

    private static final long serialVersionUID = 1L;

    @ExcelIgnore//表示这个字段不会被导入或导出到 Excel 中
    @JsonProperty("id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ExcelProperty("访问账号名")
    @ApiModelProperty("访问账号名")
    @JsonProperty("accessName")
    @TableField("access_name")
    private String accessName;

    @ExcelProperty("类路径")
    @ApiModelProperty("类路径")
    @JsonProperty("className")
    @TableField("class_name")
    private String className;

    @ExcelProperty("方法名")
    @ApiModelProperty("方法名")
    @JsonProperty("methodName")
    @TableField("method_name")
    private String methodName;

    @ExcelProperty("访问者IP地址")
    @ApiModelProperty("访问者IP地址")
    @JsonProperty("ip")
    @TableField("ip")
    private String ip;

    @ExcelProperty("接口路径")
    @ApiModelProperty("接口路径")
    @JsonProperty("url")
    @TableField("url")
    private String url;

    @ExcelProperty("接口类型")
    @ApiModelProperty("接口类型")
    @JsonProperty("method")
    @TableField("method")
    private String method;

    @ExcelProperty("返回结果")
    @ApiModelProperty("返回结果")
    @JsonProperty("result")
    @TableField("result")
    private String result;

    @ExcelProperty("返回code")
    @ApiModelProperty("返回code")
    @JsonProperty("code")
    @TableField("code")
    private String code;
    @ExcelProperty("访问时间")
    @ApiModelProperty("访问时间")
    @JsonProperty("accessDate")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField("access_date")
    private Date accessDate;
    @ExcelProperty("访问类型")
    @ApiModelProperty("访问类型")
    @JsonProperty("accessType")
    @TableField("access_type")
    private String accessType;
    @ExcelProperty("访问详细")
    @ApiModelProperty("访问详细")
    @JsonProperty("remarks")
    @TableField("remarks")
    private String remarks;



}
